# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VectorTile.V1.Model.Feature do
  @moduledoc """
  A feature representing a single geographic entity.

  ## Attributes

  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The localized name of this feature. Currently only returned for roads.
  *   `geometry` (*type:* `GoogleApi.VectorTile.V1.Model.Geometry.t`, *default:* `nil`) - The geometry of this feature, representing the space that it occupies in the world.
  *   `placeId` (*type:* `String.t`, *default:* `nil`) - Place ID of this feature, suitable for use in Places API details requests.
  *   `relations` (*type:* `list(GoogleApi.VectorTile.V1.Model.Relation.t)`, *default:* `nil`) - Relations to other features.
  *   `segmentInfo` (*type:* `GoogleApi.VectorTile.V1.Model.SegmentInfo.t`, *default:* `nil`) - Metadata for features with the SEGMENT FeatureType.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of this feature.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :displayName => String.t() | nil,
          :geometry => GoogleApi.VectorTile.V1.Model.Geometry.t() | nil,
          :placeId => String.t() | nil,
          :relations => list(GoogleApi.VectorTile.V1.Model.Relation.t()) | nil,
          :segmentInfo => GoogleApi.VectorTile.V1.Model.SegmentInfo.t() | nil,
          :type => String.t() | nil
        }

  field(:displayName)
  field(:geometry, as: GoogleApi.VectorTile.V1.Model.Geometry)
  field(:placeId)
  field(:relations, as: GoogleApi.VectorTile.V1.Model.Relation, type: :list)
  field(:segmentInfo, as: GoogleApi.VectorTile.V1.Model.SegmentInfo)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.VectorTile.V1.Model.Feature do
  def decode(value, options) do
    GoogleApi.VectorTile.V1.Model.Feature.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VectorTile.V1.Model.Feature do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
